/**
 * 
 */
package neptune.web.client.view;

/**
 * This interface is implemented from views that have an internal state that can be referred
 * through a string. This string is obtained with the encodeState() method and is used in HistoryTokens.
 * <br/><br/>
 * When the view must be set to the state encoded in the string, the method setState(), which takes
 * the encoded string as param, is called.
 * 
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 *
 */
public interface HasState {
	
	/**
	 * encodes this instance state in a string
	 * 
	 * @return
	 */
	public String encodeState();
	
	/**
	 * Decodes a string encoded through {@link HasState.encodeState()} and sets this instance to the given state.
	 * 
	 * @param encodedStateString
	 */
	public void setState(String encodedStateString);

}
